package main.java.rock.acm.dp;

import java.util.*;

public class Main13 {
    private static int[] P={0,2,3,4};
    private static int[] V={0,3,4,5};
    private static int[] M={0,4,3,2};
    private static int T = 15;

    private static Integer[][] results = new Integer[P.length + 1][T + 1];

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int n_zrray_1[] = new int[n];
        int n_zrray_2[] = new int[n];
        for (int i = 0;scan.hasNextInt();i++){
            n_zrray_1[i] = scan.nextInt();
        }
        for (int i = 0;scan.hasNextInt();i++){
            n_zrray_2[i] = scan.nextInt();
        }

        System.out.println("n_zrray_2 = " + n_zrray_2);
    }
    public static int coinChange(int[] cs, int cnt) {
        int n = cs.length;
        int[][] f_one = new int[n + 1][cnt + 1];
        int[][] f_two = new int[n + 1][cnt + 1];
        // 初始化（没有任何硬币的情况）：只有 f[0][0] = 0；其余情况均为无效值。
        // 这是由「状态定义」决定的，当不考虑任何硬币的时候，只能凑出总和为 0 的方案，所使用的硬币数量为 0
        for (int i = 1; i <= cnt; i++) f_one[0][i] = Integer.MAX_VALUE;

        // 有硬币的情况
        for (int i = 1; i <= n; i++) {
            int val = cs[i - 1];
            for (int j = 0; j <= cnt; j++) {
                // 不考虑当前硬币的情况
                f_one[i][j] = f_one[i - 1][j];

                // 考虑当前硬币的情况（可选当前硬币个数基于当前容量大小）
                for (int k = 1; k * val <= j; k++) {
                    if (f_one[i - 1][j - k * val] != Integer.MAX_VALUE) {
                        if(f_one[i][j] <  f_one[i-1][j-k*val] + k){
                            f_one[i][j] = f_one[i][j];
                        }else{
                            f_one[i][j] =  f_one[i-1][j-k*val] + k;
                            f_one[i-1][j-k*val] = f_two[i-1][j-k*val];

                        }
                    }
                }
            }
        }
        return f_one[n][cnt] == Integer.MAX_VALUE ? -1 : f_one[n][cnt];
    }
}
